<?php
namespace app\app\controller\v1;
use app\app\Appbase;
use think\facade\Session;
use app\admin\model\SystemParamValue;
//
//其他
//
class Other extends Appbase 
{
	
	/**
	*商城顶部banner图
	* /app/v1/other/goodsBanner
	* 需要登录 
	* @is_need_login false
	*/
	public function goodsBanner(){
		try {
			//TODO 首页banner图
	        $banner =  SystemParamValue::getSlides('buess_goods_banner') ?: [];
			//返回
			return $this->ReSucess( compact('banner') );	
		} catch (\Exception $e) {
			return $this->ReError($e->getMessage());	
		}
	}
	
	
	/**
	*获取服务条款
	* /app/v1/other/getService
	* 需要登录 
	* @is_need_login false
	*/
	public function getService(){
		try {
			$result = model('admin/SystemParamValue')->where('param_code','registration_page_service_explain')->value('param_value');
			if(!$result){
				return $this->ReError($result);
			}
			return $this->ReSucess(  htmlspecialchars_decode($result) );	
		} catch (\Exception $e) {
			return $this->ReError($e->getMessage());	
		}
	}
	
	
	/**
	*获取隐私政策
	* /app/v1/other/getPolicy
	* 需要登录 
	* @is_need_login false
	*/
	public function getPolicy(){
		try {
			$result = model('admin/SystemParamValue')->where('param_code','registration_page_privacy_explain')->value('param_value');
			if(!$result){
				return $this->ReError($result);
			}
			return $this->ReSucess(htmlspecialchars_decode($result));	
		} catch (\Exception $e) {
			return $this->ReError($e->getMessage());	
		}
	}
	
	
	
}



